#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>
#include<string.h>
#include<assert.h>

int mystrcmp(const char* str1, const char* str2)
{
	assert(str1 && str2);
	while (*str1==*str2)
	{
		if (*str1 == '\0')
			return 0;
		str1++;
		str2++;
	}
	/*if (*str1 > *str2)
		return 1;
	else
		return -1;*/
	return (*str1 - *str2);
}

void calc(int(*cmp)(const char*, const char*),const char* arr1,const char* arr2)
{
	if (cmp(arr1, arr2) > 0)
		printf(">\n");
	else if (cmp(arr1, arr2) == 0)
		printf("=\n");
	else
		printf("<\n");
}

void test1()
{
	char arr1[] = "abc";
	char arr2[] = "abc";
	char arr3[] = "abcd";
	char arr4[] = "ab";
	printf("arr1 = %s, arr2 = %s, arr3 = %s, arr4 = %s\n",arr1,arr2,arr3,arr4);
	calc(strcmp,arr1,arr2);
	calc(strcmp, arr1, arr3);
	calc(strcmp, arr1, arr4);
	printf("------------------------\n");
}

void test2()
{
	char arr1[] = "abc";
	char arr2[] = "abc";
	char arr3[] = "abcd";
	char arr4[] = "ab";
	calc(mystrcmp,arr1,arr2);
	calc(mystrcmp,arr1,arr3);
	calc(mystrcmp,arr1,arr4);
}

int main()
{
	test1();
	test2();
	return 0;
}